package com.dashboard.cloud.nacos.configure.service;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.Properties;

/**
 * All rights Reserved, Designed By www.super-master.com
 *
 * @ProjectName: spring-cloud-dashboard
 * @Package: com.dashboard.cloud.nacos.configure.service
 * @ClassName: NacosConfigureService
 * @Description: []
 * <p> </p>
 * @Author: [Lance Ting]
 * @Date: 2024/11/8 14:34
 * @Version: V1.0
 * @Copyright: 2024 www.super-master.com Inc. All rights reserved.
 * TODO: 注意,本文件Lance Ting所作,如果转载或使用请标明具体出处!
 **/
@Service
public class NacosSimpleConfigureService {

    // 简单案例中，如果nacos服务端修改配置后，如果客户端服务没有发布之前，读取的数据依旧是客户端服务启动时刻的数据

    @Value("${nacos.configure.simple.info}")
    private String configInfo;

    public Properties obtainSimpleConfigure() {
        Properties properties = new Properties();
        properties.put("simple.info", configInfo);
        return properties;
    }
}